<%@ page import="java.net.URLDecoder" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>海尔官网|登录</title>
		<!-- 加载bootstrap与jQuery -->
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<!-- 加载BootStrap脚本-->
		<script type="text/javascript" src="js/bootstrap.min.js"></script>
	</head>
	<style>
		#headtext a{
			text-decoration: none;
			color: #005aaa
		}
		#headtext a:hover{

			color: #e4b9b9;

		}
	</style>
	<body style="background: url(img/login_bg.webp);">
		<!-- 顶部导航条部分-->
		<nav class="navbar navbar-default navbar-fixed-top" style="padding-top:10px;">
			<div class="container">
				<div class="row">
					<div class="col-md-2" style="padding-bottom: 0px;">
						<a href="index.jsp"><img src="img/haier2020_logo.webp" style="height: 65px;"></a>
					</div>
					<div class="col-md-2" style="padding: 10px;">
						<p style="font-size: 20px;padding-top: 5px;">账号登录</p>
					</div>
					<div id="headtext" class="col-md-offset-5 col-md-3">
						<p style="padding-top: 20px; "><a href="sign_in.jsp" \>注册海尔账号</a></p>
					</div>
				</div>
			</div>
		</nav>
		
		<div class="container">
			<div class="row">
				<!-- 左边文字部分-->
				<div class="col-md-8">
					<h1 style="font-size: 50px; font-weight: 700;  font-style:normal; margin-top: 200px;color: #FFF;">欢迎回到海尔世界</h1>
					<br>
					<h1 style="color: #FFF; font-weight: 700; font-style:normal;">一个账号遍历享受海尔所有服务</h1>
				</div>
				<!-- 用户登录部分-->

				<div class="col-md-4">

					<%
						String[] split1=null;
						Cookie[] cookies = request.getCookies();
						if (cookies!=null){
							for(Cookie cookie :cookies){
								if("autoboxingInfo".equals(cookie.getName())){
									String info = URLDecoder.decode(cookie.getValue());

									split1 = info.split(":");
								}
							}
						}
					%>
					<form class="form-horizontal" style="margin-top: 150px; background-color: rgba(255,255,255,0.7);border-radius: 20px;padding: 10px;" action="login" method="post">
						<h2 align="center" class="modal-title" id="myModalLabel">用户登录</h2>

						<div class="form-group">
							<label for="Tel" class="col-sm-3 control-label">用户名</label>
							<div class="col-sm-9">
								<input type="tel"  name="username" class="form-control" id="Tel" placeholder="请输入用户名" value="<%
								if (split1!=null){
									String username=split1[0];

									out.print(username);
								}
								%>">
							</div>
						</div>
						<div class="form-group">
							<%--@declare id="password"--%><label for="password" class="col-sm-3 control-label">密码</label>
							<div class="col-sm-9">
								<input type="password" class="form-control" name="password" id="tPassword" placeholder="请输入密码" value="<%
								if (split1!=null){
									String loginInfo = (String) request.getAttribute("loginInfo");
									if (loginInfo!=null){

									}else {
										String password=split1[1];
									out.print(password);
									}

								}
								%>">
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-3 col-sm-9">
								<div class="checkbox">
									<label>
										<input type="checkbox" name="autoLogin" value="auto" <%
											if(split1!=null){
												String loginInfo = (String) request.getAttribute("loginInfo");
												if(loginInfo!=null){

												}else {
													out.print("checked='checked'");
												}
											}
										%>> 记住密码
									</label>
								</div>
							</div>
						</div>
						<div class="form-group">
							<div class="col-sm-offset-3 col-sm-9">
								<button type="submit" class="btn btn-default" style="width: 70px;" id="login">登录  </button><span style="color: #843534"><%
								String loginInfo = (String) request.getAttribute("loginInfo");
								if (loginInfo != null) {
									out.print(loginInfo);
								}
							%></span>

							</div>
						</div>
					</form>

				</div>
			</div>
			<!--底部导航栏-->
			<nav class="navbar navbar-inverse navbar-fixed-bottom">
				<div class="container" style="height: 30px;text-align: center;">
					<p style="padding-top: 15px;"><span style="color: #FFFFFF; ">Copyright 2020 海尔集团 版权所有</span></p>
				</div>
			</nav>
		</div>
	</body>
</html>
